<%--
  Created by IntelliJ IDEA.
  User: 凉城
  Date: 2021/12/17
  Time: 11:57
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<form method="get" action="./login.do">
    <%
        Cookie[] cookies = request.getCookies();
        String username="";
        String password="";
        if (cookies.length>0){
            for (Cookie cookie:cookies) {
                System.out.println(cookie.getName());
                System.out.println(cookie.getValue());
                if (cookie.getName().equals("username")){
                    username=cookie.getValue();
                }
                if (cookie.getName().equals("password")){
                    password=cookie.getValue();
                }
            }
        }
    %>
    用户名：<input type="text" name="username" value="<%=username%>"><br>
    密码：<input type="password" name="password" value="<%=password%>"><br>
    <button type="submit">登录</button>
</form>
</body>
</html>
